package APIBuffer;
import structure.t_buf_PFD;

public class animData
{
	public static void initDatasPFD_test(t_buf_PFD buf)
	{
		buf.fTangage = 0.0f;
		buf.fRoulis = 0.0f;
		buf.fSideSlip = 0.0f;
		buf.bFD = 1;
		buf.fDevVert = 5.0f;
		buf.fDevHori = 5.0f;
		buf.fAlti = 2700.0f;
		buf.fVitesse = 112.0f;
		buf.fVitDecrochage = 100.0f;
		buf.fVit10s = 125.0f;
		buf.bVit10s = 1;
		buf.fCap = 115.0f;
		buf.fVz = 500.0f;
		buf.fLock = 2.4f;
		buf.fGlide = 2.4f;
		buf.bILS = 1;
		buf.fVitAlphaProt = 85;
		buf.fVitVLS = 95;
		buf.fVitVMO = 150;
		buf.fVitProtection = 140;
		buf.ATHR = 2;
		buf.ATHRmode = 4;
		buf.AP = 1;
		buf.mode_lat = 9;
		buf.latArm = 7;
		buf.mode_vert = 0;
		buf.vertArm = 6;
		buf.combined = 11;
		buf.vertspeed = 222;
		buf.cat = 12;
		buf.dh = 300;
		buf.speedTgt = 132;
		buf.altTgt = 50000;
		buf.altLvl = 1;
		buf.altiradio = 526;
	}
	public static void animDatasPFD_test(t_buf_PFD buf)
	{
		//--- variables test PFD
		float DELTA_tangage  = -0.015f;
		float DELTA_roulis   =  0.04f;
		float DELTA_sideSlip =  0.1f;
		float DELTA_vert     =  0.006f;
		float DELTA_hori     =  0.004f;
		float DELTA_alti     = -0.4f;
		float DELTA_vitesse  = -0.025f;
		float DELTA_vit10s   = -0.04f;
		float DELTA_cap      =  0.08f;
		float DELTA_vz       =  0.6f;
		float DELTA_lock     =  0.004f;
		float DELTA_glide    = -0.0025f;

		if (!buf.equals(null))
		{
			//-----------------------------------------
			// Horizon
			//-----------------------------------------
			//--- roulis
			buf.fRoulis = buf.fRoulis + DELTA_roulis;
			if ((buf.fRoulis < -45) || (buf.fRoulis > 45))
			{
				DELTA_roulis = -DELTA_roulis;
			}

			//--- tangage
			buf.fTangage = buf.fTangage + DELTA_tangage;
			if ((buf.fTangage < -60) || (buf.fTangage > 60))
			{
				DELTA_tangage = -DELTA_tangage;
			}

			//--- sideSlip
			buf.fSideSlip = buf.fSideSlip + DELTA_sideSlip;
			if ((buf.fSideSlip < -45) || (buf.fSideSlip > 45))
			{
				DELTA_sideSlip = -DELTA_sideSlip;
			}

			//-----------------------------------------
			// Anemometre
			//-----------------------------------------
			buf.fVitesse = buf.fVitesse + DELTA_vitesse;
			if ((buf.fVitesse < 0) || (buf.fVitesse > 999))
			{
				DELTA_vitesse = -DELTA_vitesse;
			}

			buf.fVit10s = buf.fVit10s + DELTA_vit10s;
			if ((buf.fVit10s < 100) || (buf.fVit10s > 150))
			{
				DELTA_vit10s = -DELTA_vit10s;
			}

			//-----------------------------------------
			// Altimetre
			//-----------------------------------------
			buf.fAlti = buf.fAlti + DELTA_alti;
			if ((buf.fAlti < 0) || (buf.fAlti > 90000))
			{
				DELTA_alti = -DELTA_alti;
			}

			//-----------------------------------------
			// Cap
			//-----------------------------------------
			buf.fCap = buf.fCap + DELTA_cap;
			if ((buf.fCap < 0) || (buf.fCap > 360))
			{
				DELTA_cap = -DELTA_cap;
			}

			//-----------------------------------------
			// Variometre
			//-----------------------------------------
			buf.fVz = buf.fVz + DELTA_vz;
			if ((buf.fVz < -3500.0) || (buf.fVz > 3500.0))
			{
				DELTA_vz = -DELTA_vz;
			}

			//-----------------------------------------
			// ILS
			//-----------------------------------------
			buf.fLock = buf.fLock + DELTA_lock;
			if ((buf.fLock < -7) || (buf.fLock > 7))
			{
				DELTA_lock = -DELTA_lock;
			}

			buf.fGlide = buf.fGlide + DELTA_glide;
			if ((buf.fGlide < -7) || (buf.fGlide > 7))
			{
				DELTA_glide = -DELTA_glide;
			}

			//-----------------------------------------
			// FD
			//-----------------------------------------
			buf.fDevVert = buf.fDevVert + DELTA_vert;
			if ((buf.fDevVert < -15) || (buf.fDevVert > 15))
			{
				DELTA_vert = -DELTA_vert;
			}

			buf.fDevHori = buf.fDevHori + DELTA_hori;
			if ((buf.fDevHori < -15) || (buf.fDevHori > 15))
			{
				DELTA_hori = -DELTA_hori;
			}
		}
	}
}